#!/usr/bin/env python 
# -*- coding:utf-8 -*-
"""
@Time:2021/12/11 3:44 下午"
@Author:lydia_liu"
@File:member_page.py
@function:
"""
from time import sleep


from selenium.webdriver.common.by import By

from po_master.page_object.base_page import BasePage


class MemberPage(BasePage):
    _NAME = (By.ID, 'username')
    _ACCTID = (By.ID, 'memberAdd_acctid')
    _PHONE = (By.ID, 'memberAdd_phone')
    _SAVEBTN = (By.LINK_TEXT, '保存')


    def fill_out_member(self,name,acctid,phone):
        from po_master.page_object.contact_page import ContactPage
        print("在添加成员页面，输入成员信息")
        self.sendkey(*self._NAME,name)
        self.sendkey(*self._ACCTID,acctid)
        self.sendkey(*self._PHONE,phone)

        print("点击保存按钮")
        # self.driver.find_element(*self._SAVEBTN).click()
        self.onclick(*self._SAVEBTN)
        sleep(5)

        return ContactPage(self.driver)

    def fill_out_member_fail(self):
        #添加失败的方法
        pass